from django.contrib import admin
from django.urls import path

from customer.views import customer_list, customer_add, customer_update, customer_delete, customer_find_by_id, \
    export_customers_csv
from djangoProject.views import index
from employee.views import employee_list, employee_delete, employee_update, employee_find_by_id, employee_add, \
    export_employees_csv
from good.views import good_list, good_add, good_update, good_delete, good_find_by_id, export_goods_csv
from member.views import member_list, member_update, member_delete, member_find_by_id, member_add
from pay.views import pay_main_list, pay_main_update, pay_main_delete, pay_main_add, pay_detail_list, pay_detail_add, \
    pay_detail_update, pay_detail_delete, export_pay_main_csv
from user.views import user_login, user_info, change_password, user_add, user_delete, find_by_id, update_user, \
    user_list, user_logout

urlpatterns = [
    path('index', index, name='index'),
    path('', user_login),
    path('user/login', user_login, name='login'),
    path('user_info/', user_info, name='user_info'),  # 用户信息管理页面
    path('change_password/', change_password, name='change_password'),  # 用户信息管理页面
    path('user_add', user_add, name='user_add'),
    path('user_delete/<int:user_id>', user_delete, name='user_delete'),
    path('user_find_by_id', find_by_id, name='user_find_by_id'),
    path('user_update', update_user, name='user_update'),
    path('user_list', user_list, name='user_list'),
    path('customer_list', customer_list, name='customer_list'),
    path('customer_add', customer_add, name='customer_add'),
    path('customer_find_by_id', customer_find_by_id, name='customer_find_by_id'),
    path('customer_update', customer_update, name='customer_update'),
    path('customer_delete/<str:customer_id>', customer_delete, name='customer_delete'),
    path('employee_list', employee_list, name='employee_list'),
    path('employee_add', employee_add, name='employee_add'),
    path('employee_update', employee_update, name='employee_update'),
    path('employee_delete', employee_delete, name='employee_delete'),
    path('employee_find_by_id', employee_find_by_id, name='customer_find_by_id'),
    path('good_list', good_list, name='good_list'),
    path('good_add', good_add, name='good_add'),
    path('good_update', good_update, name='good_update'),
    path('good_delete', good_delete, name='good_delete'),
    path('good_find_by_id', good_find_by_id, name='good_find_by_id'),
    path('member_list', member_list, name='member_list'),
    path('member_add', member_add, name='member_add'),
    path('member_update', member_update, name='member_update'),
    path('member_delete/<int:Mid>/', member_delete, name='member_delete'),
    path('member_find_by_id', member_find_by_id, name='member_find_by_id'),
    path('pay_main_list', pay_main_list, name='pay_main_list'),
    path('pay_main_add', pay_main_add, name='pay_main_add'),
    path('pay_main_update/<int:pid>/', pay_main_update, name='pay_main_update'),
    path('pay_main_delete/<int:Pid>/', pay_main_delete, name='pay_main_delete'),
    path('pay_detail_list/<int:Pid>/', pay_detail_list, name='pay_detail_list'),
    path('pay_detail_add/<int:Pid>/', pay_detail_add, name='pay_detail_add'),
    path('pay_detail_update/<int:PDid>/', pay_detail_update, name='pay_detail_update'),
    path('pay_detail_delete/<int:PDid>/', pay_detail_delete, name='pay_detail_delete'),
    path('export_customers_csv/', export_customers_csv, name='export_customers_csv'),
    path('export_goods_csv/', export_goods_csv, name='export_goods_csv'),
    path('export_employees_csv/', export_employees_csv, name='export_employees_csv'),
    path('export_pay_main_csv/', export_pay_main_csv, name='export_pay_main_csv'),
    path('logout/', user_logout, name='logout'),
]
